package com.wsx.ones.dubbo.consumer;

import com.wsx.ones.api.ExampleService;
import com.wsx.ones.api.bean.ExampleRequest;
import com.wsx.ones.api.bean.ExampleResponse;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Date;

/**
 * @author wangshuaixin
 * @Title: com.wsx.ones.dubbo.consumer.ConsumerDubbo
 * @Description: TODO
 * @date 2019/04/19
 */
public class ConsumerDubbo {

    static ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath*:consumer.xml");

    public static void main(String[] args) {

        ExampleService service = context.getBean("exampleService", ExampleService.class);

        System.out.println(service.hello("wang"));

        ExampleRequest request = new ExampleRequest();
        request.setToken("123");
        request.setGlobal("afv");
        request.setName("wang");
        request.setDate(new Date());
        ExampleResponse response = service.example(request);
        System.out.println(response.getName());
    }
}
